import os

from xjlibrary.our_file_dir import BaseDir

nCount = 0
curPath = BaseDir.get_file_dir_absolute(__file__)
TopPath = BaseDir.get_upper_dir(curPath, -2)
sPath = BaseDir.get_new_path(TopPath, "download", "cell", "download", "cover")
sPath = r"\\192.168.30.177\样例数据\celljournal\celljournal_cover_all"
# 转换成base32编码

if __name__ == '__main__':
    nCount = 0
    provider = 'celljournal'
    filePath = provider + '_cover.txt'
    print('path:' + sPath)

    with open(filePath, mode='w', encoding='utf-8') as f:
        for path, dirNames, fileNames in os.walk(sPath):
            for fileName in fileNames:
                #分离文件名与扩展名 返回文件名和扩展名
                journal = os.path.splitext(fileName)[0]
                line = provider + '@' + journal + '★/smartlib/' + provider + '/' + fileName + '\n'
                f.write(line)
                nCount += 1
    print('nCount:' + str(nCount))
